<template>
	<view :style="[AppSkinVar]">
		<recordCard v-for="item in list" :key="item.id" :text="$t('user.提现')" numberKey="cashmoney" :infoSymbol="false"
			:info="item" :showStatus="true" :status="item.status === 3" :statusText="cashStatus[item.status]"
			textColor="#999999"></recordCard>
		<empty  :text="$t('user.暂无记录')" :icon="$staticPath('default_img.png')"  v-if="isEmpty">
		</empty>
		<load-more :showLoad="showLoad" v-else></load-more>
		
	</view>
</template>

<script setup lang="ts">
	import {ref} from 'vue'
	import { postExtractHistory, getDicts } from '@/common/request/api'
	import type { DictsItem } from '@/common/request/api'
	import recordCard from './child/record-card.vue'
	import {
		useQueryPage
	} from '@/common/hooks'
	import {
		onLoad,
		onReachBottom
	} from '@dcloudio/uni-app'
	
	
	const cashStatus = ref<DictsItem[]>([])
	
	const {
		showLoad,
		isEmpty,
		list,
		handleQueryPage,
		handleRefresh
	} = useQueryPage({
		api: postExtractHistory
	})
	
	
	onLoad(() => {
		handleRefresh()
		getDicts('h_cash_status').then(res => {
			cashStatus.value = res.data
		})
	})
	onReachBottom(() => {
		handleQueryPage()
	})

	
</script>

<style lang="scss" scoped>
</style>